package jmine.tec.services.export.export;

import java.util.Collections;
import java.util.List;

import jmine.tec.services.api.ActionsEnum;
import jmine.tec.services.api.export.DefaultExportAction;
import jmine.tec.services.api.export.EntityExporter;
import jmine.tec.services.api.export.ExportAction;
import jmine.tec.services.api.export.ExporterKey;
import jmine.tec.services.api.export.ReferenceMap;
import jmine.tec.services.io.ServiceBean;
import bancosys.tec.services.export.domain.AssociatedMockEntity;

public class AssociatedMockEntityExporter implements EntityExporter<AssociatedMockEntity> {

    public List<ServiceBean> export(ReferenceMap referenceMap, AssociatedMockEntity entity) {
        ServiceBean bean = new ServiceBean();
        bean.setName("AssociatedMockEntity");
        bean.setAction(ActionsEnum.INCLUIR);
        bean.getParameters().put("Mock", referenceMap.getReference(entity.getMock()));
        bean.getParameters().put("Value", entity.getValue());
        return Collections.singletonList(bean);
    }

    public List<Object> exportAfter(AssociatedMockEntity entity) {
        return Collections.emptyList();
    }

    public Class<AssociatedMockEntity> getExportedEntityClass() {
        return AssociatedMockEntity.class;
    }

    public List<Object> exportBefore(AssociatedMockEntity entity) {
        return Collections.emptyList();
    }

    public ExportAction getAction() {
        return DefaultExportAction.INCLUIR;
    }

    public ExporterKey getExporterKey() {
        return new ExporterKey(this.getAction(), this.getExportedEntityClass());
    }
}